<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>




<div class="row">
	<div class="col-12">
<div class="card">
	<form action="<?php echo url($route.'-search');?>" id="search_form">
		<div class="input-group">
			<input type="text" class="form-control" placeholder="<?php echo lang('keyword');?>" name="keyword">
			<span class="input-group-btn">
				<button class="btn btn-secondary" type="submit"><?php echo lang('search');?></button>
			</span>
		</div>
	</form>
</div>
	</div>
	<div class="col-12">
		<div class="card">
			<div class="card-header"><?php echo $header['title']; ?></div>

<?php if($itemlist) { ?>
			<ul class="list-group list-group-flush">
<?php
	//unset($columnInfos[0]);
	foreach($itemlist as &$item) {
		$title = '';
		$id = '';
		$i = 0;
		foreach($columnInfos as &$v) {
			if($i == 0) {
			$id = $item[$v['Field']];
				$i++;
				continue;
			}
			$title .= $v['Comment'] . ':' . $item[$v['Field']] . "\r\n";
		}
?>
								<li><a href="<?php echo url("$route-view-$id");?>" title="<?php echo $title; ?>"><?php echo $id; ?></a></li>
<?php } ?>
</ul>
<?php } else { ?>
			<div class="card-body">
				<p class="card-text"><?php echo lang('none');?></p>
			</div>
<?php } ?>
		</div>
	</div>
</div>

<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>

<script>
$('#nav_pc li[fid="<?php echo $fid;?>"]').tab('show');
</script>
<script>
jsearch_form = $('#search_form');
jsearch_form.on('submit', function() {
	var keyword = jsearch_form.find('input[name="keyword"]').val();
	var url = xn.url('<?php echo $route; ?>-search-all-'+xn.urlencode(keyword));
	window.location = url;
	return false;
});
</script>